
package com.oahcfly.chgame.core.data;

import java.util.HashMap;

import com.badlogic.gdx.scenes.scene2d.Action;

/** @author haocao */
public class CHUIData {

	public String targetActorName;

	public HashMap<String, String> dataMap;

	public static CHUIData createChuiData (String actionName) {
		CHUIData chuiData = new CHUIData(actionName);
		return chuiData;
	}
	
	public static CHUIData createChuiData (String actionName,Action action) {
		CHUIData chuiData = new CHUIData(actionName);
		chuiData.setAction(action);
		return chuiData;
	}

	public static CHUIData createChuiData (String actionName, HashMap<String, String> data) {
		CHUIData chuiData = new CHUIData(actionName, data);
		return chuiData;
	}

	public CHUIData (String actorName, HashMap<String, String> data) {
		this.targetActorName = actorName;
		this.dataMap = data;
	}

	public CHUIData (String actionName) {
		this.targetActorName = actionName;
	}

	public void addParam (String key, String value) {
		if (dataMap == null) {
			dataMap = new HashMap<String, String>();
		}
		dataMap.put(key, value);
	}

	private Action uiAction;

	public void setAction (Action action) {
		this.uiAction = action;
	}

	public Action getAction () {
		return uiAction;
	}

	public String getValue (String key) {
		return dataMap.get(key);
	}

	private Object object;

	public Object getDataObject () {
		return object;
	}

	public void setDataObject (Object object) {
		this.object = object;
	}

}
